Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data
Imports System.Data.SqlClient

<WebService(Namespace:="http://wroxunited.net/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
Public Class PlayerService
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function Players() As DataSet

        Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("WroxUnited").ConnectionString)
        Dim adapter As New SqlDataAdapter("SELECT PlayerID, (FirstName + ' ' + LastName) As Player FROM Players ORDER BY FirstName, LastName", conn)
        Dim ds As New DataSet()

        adapter.Fill(ds, "Players")

        Return ds

    End Function

End Class
